home *** CD-ROM | disk | FTP | other *** search
-
-
-
- MKTEMP(3) MINTLIB LIBRARY FUNCTIONS MKTEMP(3)
-
-
- N✓NA✓AM✓ME✓E
- mktemp - make a unique file name
-
- S✓SY✓YN✓NO✓OP✓PS✓SI✓IS✓S
- #include <unistd.h>
-
- char *mktemp(char *template);
-
- D✓DE✓ES✓SC✓CR✓RI✓IP✓PT✓TI✓IO✓ON✓N
- mktemp creates a unique file name, typically in a tempo-
- rary filesystem, by replacing template with a unique file
- name, and returns the address of template. The string in
- template should contain a file name with six trailing Xs;
- mktemp replaces the Xs with a number and the current pro-
- cess ID. The number will be chosen so that the resulting
- name does not duplicate an existing file.
-
- R✓RE✓ET✓TU✓UR✓RN✓N V✓VA✓AL✓LU✓UE✓ES✓S
- mktemp returns a pointer to the changed template on suc-
- cess, and NULL on failure.
-
- S✓SE✓EE✓E A✓AL✓LS✓SO✓O
- g✓ge✓et✓tp✓pi✓id✓d(✓(3✓3)✓),✓, o✓op✓pe✓en✓n(✓(3✓3)✓),✓, t✓tm✓mp✓pf✓fi✓il✓le✓e(✓(3✓3)✓),✓, t✓tm✓mp✓pn✓na✓am✓m(✓(3✓3)✓)
-
- N✓NO✓OT✓TE✓ES✓S
- The related UN*X function mkstemp is currently not avail-
- able in the mintlibs.
-
- mktemp actually changes the template string which you
- pass; this means that you cannot use the same template
- string more than once - you need a fresh template for
- every unique file you want to open.
-
- When mktemp is creating a new unique filename it checks
- for the prior existence of a file with that name. This
- means that if you are creating more than one unique file-
- name, it is bad practice to use the same root template for
- multiple invocations of mktemp.
-
- The current process id is used only if there is enough
- room in the string and MiNT is active.
-
- B✓BU✓UG✓GS✓S
- It is possible to run out of numbers.
-
-
-
-
-
-
-
-
-
-
-
-
-
- MiNT docs 0.1 3 March 1993 1
-
-
-